package com.paiai.lslease.dao.landlordauth;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.paiai.lslease.auto.model.AppSysUser;
import com.paiai.lslease.model.AppLandlordAuthHouseInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("appLandlordAuthExternalDAO")
public class AppLandlordAuthExternalDAOImpl implements AppLandlordAuthExternalDAO {

    @Autowired
    private SqlMapClient sqlMapClient;

    @Override
    public List<AppLandlordAuthHouseInfo> selectAuthedHouseInfoListByLandlordId(int landlordId) throws Exception {
        return sqlMapClient.queryForList("app_landlord_auth_info.selectAuthedHouseInfoListByLandlordId", landlordId);
    }

    @Override
    public List<AppSysUser> selectAllAuthedManager(int landlordId) throws Exception {
        return sqlMapClient.queryForList("app_landlord_auth_info.selectAuthedManagerInfoListByLandlordId", landlordId);
    }

    @Override
    public List<AppLandlordAuthHouseInfo> selectAuthedHouseInfoListByUserMobile(String userMobile) throws Exception {
        return sqlMapClient.queryForList("app_landlord_auth_info.selectAuthedHouseInfoListByAuthedUserMobile", userMobile);
    }
}
